import { ref, computed,reactive} from 'vue'
import { defineStore } from 'pinia'
import { el } from 'element-plus/es/locales.mjs'

export const useCounterStore = defineStore('counter', () => {
  const user = reactive({
	  file_name:'',
	  kb_name:'',
	  update_time:'',
	  create_time:'',
	  username:'',
	  id:'',
	  file_ext:'',
  })
  const filesurl = reactive({
    file_name:'',
    kb_name:'',
    update_time:'',
    create_time:'',
    username:'',
    id:'',
    file_ext:'',
  })
  const baseobj = reactive({
    id:'',
    kb_title:'',
    kb_name:'',
    kb_info:'',
    file_count:'',
    create_by:'',
    update_by:'',
    create_time:'',
    update_time:'',
  })
  function changbasenum(baseform:Object){    
    Object.assign(baseobj,baseform );
  }
  function changbasefiles(url:Object){
    Object.assign(filesurl,url );
    if (url!=undefined) {
      Object.assign(filesurl,url );
    }else{
      Object.assign(filesurl,{id:'-1'} );
    }
  }
  return { baseobj,changbasenum,changbasefiles,filesurl,user}
})
